/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package unc.pds.facets;

import unc.pds.filemodel.FolderRemote;

/**
 *
 * @author Mikhail
 */
public class AddFileFacet implements Facet {
    public AddFileFacet(FolderRemote folder) {
        this.folder = folder;
    }
    private FolderRemote folder;
    public String draw() throws Exception {
        String result = "";
        result += "<h4>Новый файл:</h4>\n";
        result += "<form action=\"upload.jsp\" method=\"post\" enctype=\"multipart/form-data\" onsubmit=\"return validateEmpty('filename');\">\n";
        result += "<input type=\"hidden\" name=\"objid\" value=\"" + folder.getKey() + "\"/>\n";
        result += "<p><input type=\"file\" name=\"filename\" id=\"filename\"/></p>\n";
        result += "<p><input type=\"submit\" value=\"Добавить\"/></p>\n";
        result += "</form>\n";
        return result;
    }
    public boolean isSide() {
        return false;
    }
}
